package com.neucollege.system.context;

public class UserContext {
    private static final ThreadLocal<Object> threadLocal = new ThreadLocal<>();

    /**
     * 存储当前用户
     * @return
     */
    public static Object getUser(){
        return threadLocal.get();
    }

    /**
     * 获取当前用户
     * @param user
     */
    public static void saveUser(Object user){
        threadLocal.set(user);
    }

    public static void remove(){
        threadLocal.remove();
    }
}
